//
//  UIImageExtension.swift
//  Jock
//
//  Created by HD on 15/3/19.
//  Copyright (c) 2015年 Haidy. All rights reserved.
//

import UIKit

extension UIImage {
    
    func scaleToSize(size: CGSize) -> UIImage {
        UIGraphicsBeginImageContext(size)
        drawInRect(CGRectMake(0, 0, size.width, size.height))
        let image = UIGraphicsGetImageFromCurrentImageContext()
        UIGraphicsEndImageContext()
        return image
    }
}
